package map;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapDemo3 {
    public static void main(String[] args) {
        Map<String,Integer>map=new HashMap<>();
        map.put("语文",90);
        map.put("数学",96);
        map.put("英语",99);
        map.put("物理",97);
        map.put("化学",92);
        System.out.println(map);

        Set<String>Keyset=map.keySet();
        for(String key: map.keySet()){
            System.out.println("key:"+key);


            Collection<Integer>value=map.values();
            for(Integer values: map.values()){
                System.out.println("value:"+values);


                Set<Map.Entry<String,Integer>>entrySet=map.entrySet();
                for(Map.Entry<String,Integer>e:entrySet){
                    String key1 = e.getKey();
                    Integer value1=e.getValue();
                    System.out.println("key:"+key1+"value:"+value1);
                }
            }
        }
    }
}
